3.3.5 \(\int \frac {(c+d x)^2}{x^3 (a+b x)} \, dx\)

Optimal. Leaf size=67 \[ \frac {\log (x) (b c-a d)^2}{a^3}-\frac {(b c-a d)^2 \log (a+b x)}{a^3}+\frac {c (b c-2 a d)}{a^2 x}-\frac {c^2}{2 a x^2} \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {88} \begin {gather*} \frac {c (b c-2 a d)}{a^2 x}+\frac {\log (x) (b c-a d)^2}{a^3}-\frac {(b c-a d)^2 \log (a+b x)}{a^3}-\frac {c^2}{2 a x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(x^3*(a + b*x)),x]

[Out]

-c^2/(2*a*x^2) + (c*(b*c - 2*a*d))/(a^2*x) + ((b*c - a*d)^2*Log[x])/a^3 - ((b*c - a*d)^2*Log[a + b*x])/a^3

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin {align*} \int \frac {(c+d x)^2}{x^3 (a+b x)} \, dx &=\int \left (\frac {c^2}{a x^3}+\frac {c (-b c+2 a d)}{a^2 x^2}+\frac {(-b c+a d)^2}{a^3 x}-\frac {b (-b c+a d)^2}{a^3 (a+b x)}\right ) \, dx\\ &=-\frac {c^2}{2 a x^2}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \log (x)}{a^3}-\frac {(b c-a d)^2 \log (a+b x)}{a^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 60, normalized size = 0.90 \begin {gather*} -\frac {\frac {a c (a c+4 a d x-2 b c x)}{x^2}-2 \log (x) (b c-a d)^2+2 (b c-a d)^2 \log (a+b x)}{2 a^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(x^3*(a + b*x)),x]

[Out]

-1/2*((a*c*(a*c - 2*b*c*x + 4*a*d*x))/x^2 - 2*(b*c - a*d)^2*Log[x] + 2*(b*c - a*d)^2*Log[a + b*x])/a^3

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(c+d x)^2}{x^3 (a+b x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(c + d*x)^2/(x^3*(a + b*x)),x]

[Out]

IntegrateAlgebraic[(c + d*x)^2/(x^3*(a + b*x)), x]

________________________________________________________________________________________

fricas [A]  time = 1.07, size = 93, normalized size = 1.39 \begin {gather*} -\frac {a^{2} c^{2} + 2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x^{2} \log \left (b x + a\right ) - 2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x^{2} \log \relax (x) - 2 \, {\left (a b c^{2} - 2 \, a^{2} c d\right )} x}{2 \, a^{3} x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^3/(b*x+a),x, algorithm="fricas")

[Out]

-1/2*(a^2*c^2 + 2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*x^2*log(b*x + a) - 2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*x^2*log
(x) - 2*(a*b*c^2 - 2*a^2*c*d)*x)/(a^3*x^2)

________________________________________________________________________________________

giac [A]  time = 0.99, size = 101, normalized size = 1.51 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | x \right |}\right )}{a^{3}} - \frac {{\left (b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{a^{3} b} - \frac {a^{2} c^{2} - 2 \, {\left (a b c^{2} - 2 \, a^{2} c d\right )} x}{2 \, a^{3} x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^3/(b*x+a),x, algorithm="giac")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(abs(x))/a^3 - (b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*log(abs(b*x + a))/(a^3*b
) - 1/2*(a^2*c^2 - 2*(a*b*c^2 - 2*a^2*c*d)*x)/(a^3*x^2)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 110, normalized size = 1.64 \begin {gather*} \frac {d^{2} \ln \relax (x )}{a}-\frac {d^{2} \ln \left (b x +a \right )}{a}-\frac {2 b c d \ln \relax (x )}{a^{2}}+\frac {2 b c d \ln \left (b x +a \right )}{a^{2}}+\frac {b^{2} c^{2} \ln \relax (x )}{a^{3}}-\frac {b^{2} c^{2} \ln \left (b x +a \right )}{a^{3}}-\frac {2 c d}{a x}+\frac {b \,c^{2}}{a^{2} x}-\frac {c^{2}}{2 a \,x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/x^3/(b*x+a),x)

[Out]

-1/2*c^2/a/x^2+1/a*ln(x)*d^2-2/a^2*ln(x)*b*c*d+1/a^3*ln(x)*b^2*c^2-2*c/a/x*d+c^2/a^2/x*b-1/a*ln(b*x+a)*d^2+2/a
^2*ln(b*x+a)*b*c*d-1/a^3*ln(b*x+a)*b^2*c^2

________________________________________________________________________________________

maxima [A]  time = 1.15, size = 88, normalized size = 1.31 \begin {gather*} -\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right )}{a^{3}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \relax (x)}{a^{3}} - \frac {a c^{2} - 2 \, {\left (b c^{2} - 2 \, a c d\right )} x}{2 \, a^{2} x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^3/(b*x+a),x, algorithm="maxima")

[Out]

-(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(b*x + a)/a^3 + (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(x)/a^3 - 1/2*(a*c^2 -
2*(b*c^2 - 2*a*c*d)*x)/(a^2*x^2)

________________________________________________________________________________________

mupad [B]  time = 0.38, size = 89, normalized size = 1.33 \begin {gather*} -\frac {\frac {c^2}{2\,a}+\frac {c\,x\,\left (2\,a\,d-b\,c\right )}{a^2}}{x^2}-\frac {2\,\mathrm {atanh}\left (\frac {{\left (a\,d-b\,c\right )}^2\,\left (a+2\,b\,x\right )}{a\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,{\left (a\,d-b\,c\right )}^2}{a^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^2/(x^3*(a + b*x)),x)

[Out]

- (c^2/(2*a) + (c*x*(2*a*d - b*c))/a^2)/x^2 - (2*atanh(((a*d - b*c)^2*(a + 2*b*x))/(a*(a^2*d^2 + b^2*c^2 - 2*a
*b*c*d)))*(a*d - b*c)^2)/a^3

________________________________________________________________________________________

sympy [B]  time = 1.39, size = 187, normalized size = 2.79 \begin {gather*} \frac {- a c^{2} + x \left (- 4 a c d + 2 b c^{2}\right )}{2 a^{2} x^{2}} + \frac {\left (a d - b c\right )^{2} \log {\left (x + \frac {a^{3} d^{2} - 2 a^{2} b c d + a b^{2} c^{2} - a \left (a d - b c\right )^{2}}{2 a^{2} b d^{2} - 4 a b^{2} c d + 2 b^{3} c^{2}} \right )}}{a^{3}} - \frac {\left (a d - b c\right )^{2} \log {\left (x + \frac {a^{3} d^{2} - 2 a^{2} b c d + a b^{2} c^{2} + a \left (a d - b c\right )^{2}}{2 a^{2} b d^{2} - 4 a b^{2} c d + 2 b^{3} c^{2}} \right )}}{a^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/x**3/(b*x+a),x)

[Out]

(-a*c**2 + x*(-4*a*c*d + 2*b*c**2))/(2*a**2*x**2) + (a*d - b*c)**2*log(x + (a**3*d**2 - 2*a**2*b*c*d + a*b**2*
c**2 - a*(a*d - b*c)**2)/(2*a**2*b*d**2 - 4*a*b**2*c*d + 2*b**3*c**2))/a**3 - (a*d - b*c)**2*log(x + (a**3*d**
2 - 2*a**2*b*c*d + a*b**2*c**2 + a*(a*d - b*c)**2)/(2*a**2*b*d**2 - 4*a*b**2*c*d + 2*b**3*c**2))/a**3

________________________________________________________________________________________